#import "OmForgetPasswordVC.h"
#import "OmChangePasswordVC.h"
@interface OmForgetPasswordVC ()
@property (nonatomic, strong) UITextField *mailField;
@property (nonatomic, strong) UIView *lineForMailField;
@property (nonatomic, strong) UILabel *tipLabel;
@property (nonatomic, strong) UIButton *sendButton;
@end
@implementation OmForgetPasswordVC
- (void)configSelf {
    self.title = ASLocalizedString(@"忘记密码");
    [self setHiddenForTabBar:YES navigationBar:NO];
}
- (void)allocateComponents {
    self.mailField = [[UITextField alloc] init];
    [self.mailField setFont:RPXFont(15)];
    self.mailField.placeholder = ASLocalizedString(@"请输入邮箱");
    [self.view addSubview:self.mailField];
    self.lineForMailField = [[UIView alloc] init].fp_backgroundColor(HexadecimalColor(@"#F07896"));
    [self.view addSubview:self.lineForMailField];
    self.tipLabel = [[UILabel alloc] init]
    .fp_text(ASLocalizedString(@"我们会将验证码发送到您的邮箱。然后输入您的验证码。"))
    .fp_font(RPXFont(12))
    .fp_textColor(HexadecimalColor(@"#999999"));
    [self.view addSubview:self.tipLabel];
    self.sendButton = [[UIButton alloc] init].fp_addTargetActionForControlEvents(self,@selector(onSendButtonTap), UIControlEventTouchUpInside);
    [self.sendButton setBackgroundImage:IMAGE_NAMED(@"OmButton0") forState:UIControlStateNormal];
    [self.sendButton setTitle:ASLocalizedString(@"发送") forState:UIControlStateNormal];
    [self.sendButton setTitleEdgeInsets:UIEdgeInsetsMake(0, 0, RPX(22), 0)];
    self.sendButton.titleLabel.font = RPXFont(14);
    [self.view addSubview:self.sendButton];
}
- (void)layoutComponents {
    [self.mailField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(RPX(30));
        make.right.equalTo(self.view).offset(RPX(-30));
        make.top.equalTo(self.view).offset(RPX(32));
    }];
    [self.lineForMailField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mailField.mas_bottom).offset(RPX(13));
        make.centerX.equalTo(self.view);
        make.width.equalTo(@(RPX(345)));
        make.height.equalTo(@(1));
    }];
    [self.tipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.lineForMailField);
        make.top.equalTo(self.lineForMailField.mas_bottom).offset(RPX(12));
    }];
    [self.sendButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.lineForMailField).offset(RPX(75));
        make.centerX.equalTo(self.view);
        make.width.equalTo(@(RPX(180)));
        make.height.equalTo(@(RPX(66)));
    }];
}
- (void)onSendButtonTap {
    OmChangePasswordVC *vc = [[OmChangePasswordVC alloc] init];
    [self.navigationController pushViewController:vc animated:YES];
}
@end
